import axios from '@/libs/api.request'
import config from '@/config'
/**
 *  发热记录接口
 */

// 发热温度统计
export const temperatureAlllist = (data) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/as/csc/hatstate/temperatureAlllist',
    type: 'post',
    data: data
  })
}
/**
 *  统计接口
 */

// 人员状态统计
export const getAllIllnessStateNum = (data) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/us/csc/hatstate/getAllIllnessStateNum',
    type: 'get',
    data: data
  })
}
// 人员状态区统计
export const findAllIllnessStateNumAreaList = (data) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/us/csc/hatstate/findAllIllnessStateNumAreaList',
    type: 'get',
    data: data
  })
}
// 区县总统计
export const sumAllList = (data) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/us/csc/hatstate/sumAllList',
    type: 'get',
    data: data
  })
}
// 区县日总统计
export const sumTodayList = (data) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/us/csc/hatstate/sumTodayList',
    type: 'get',
    data: data
  })
}
// 发热人数区统计
export const sumHotArea = (data) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/us/csc/hatstate/findsumHotArealist',
    type: 'get',
    data: data
  })
}
// 发热人数日统计
export const sumHotDaty = (data) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/us/csc/hatstate/findsumHotDatylist',
    type: 'get',
    data: data
  })
}
// 途经类型人数区统计
export const sumAddressTypeArea = (data) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/us/csc/hatstate/findsumAddressTypeArealist',
    type: 'get',
    data: data
  })
}
// 途经类型人数日统计
export const sumAddressTypeDate = (data) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/us/csc/hatstate/findsumAddressTypeDatelist',
    type: 'post',
    data: data
  })
}
// 密切接触人数区统计
export const findsumFollowArealist = (data) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/us/csc/hatstate/findsumFollowArealist',
    type: 'get',
    data: data
  })
}
// 密切接触人数日统计
export const findsumFollowDatylist = (data) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/us/csc/hatstate/findsumFollowDatylist',
    type: 'get',
    data: data
  })
}

/**
 *  人员发热列表接口
 * @returns {Promise | Promise<unknown> | AxiosPromise}
 */
export const temperaturelist = (data) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/as/csc/hatstate/temperaturelist',
    type: 'post',
    data: data
  })
}
export const userlist = (data) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/as/csc/hatstate/userlist',
    type: 'post',
    data: data
  })
}
// 添加体温信息
export const createtemperature = (data) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/ac/csc/HatStateService/createtemperature',
    type: 'post',
    data: data
  })
}
export function date0str (date, containtime) {
  if (!date || typeof date === 'string') {
    return date
  }
  var time1 = date.getFullYear()
  var month = date.getMonth() + 1
  var day = date.getDate()
  var hour = date.getHours()
  var min = date.getMinutes()
  var second = date.getSeconds()
  time1 += '-' + (month < 10 ? '0' + month : month)
  time1 += '-' + (day < 10 ? '0' + day : day)
  time1 += ' ' + (hour < 10 ? '0' + hour : hour)
  time1 += ':' + (min < 10 ? '0' + min : min)
  time1 += ':' + (second < 10 ? '0' + second : second)
  return time1
}
// 添加发热人员信息
export const createuserinfo = (data) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/ac/csc/HatStateService/createuserinfo',
    type: 'post',
    data: data
  })
}
// 修改发热人员信息
export const updateuserinfo = (data) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/ac/csc/HatStateService/updateuserinfo',
    type: 'post',
    data: data
  })
}
// 用户id查询人员基本信息
export const getuserinfo = (userid) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/as/csc/hatstate/userinfo',
    type: 'post',
    data: { id: userid }
  })
}
// 用户id删除人员信息
export const delbyid = (data) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/as/csc/hatstate/delbyid',
    type: 'post',
    data: data
  })
}
// 添加绑定信息(1同行人|2接触人)
export const createuserband = (data) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/as/csc/hatstate/createuserband',
    type: 'post',
    data: data
  })
}
// 删除绑定信息(1同行人|2接触人)
export const delbanduser = (bandid) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/as/csc/hatstate/delbanduser',
    type: 'post',
    data: { id: bandid }
  })
}
// 更新绑定信息(1同行人|2接触人)
export const updatebanduser = (data) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/as/csc/hatstate/updatebanduser',
    type: 'post',
    data: data
  })
}
// 查询绑定信息-分页接口(1同行人|2接触人)
export const banduserlist = (data) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/as/csc/hatstate/banduserlist',
    type: 'post',
    data: data
  })
}
// 删除体温信息
export const deltemperature = (data) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/as/csc/hatstate/deltemperature',
    type: 'post',
    data: data
  })
}
// 更新体温信息
export const updatetemperature = (data) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/ac/csc/HatStateService/updatetemperature',
    type: 'post',
    data: data
  })
}
// 区，街道，社区级联接口
export const getMailLevelList = (data) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/as/csc/auditmail/getMailLevelList',
    type: 'post',
    data: data
  })
}
// 人员信息迁出接口
export const updateusercompanycode = (data) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/as/csc/hatstate/updateusercompanycode',
    type: 'post',
    data: data
  })
}
// 人员信息导出接口
export const findOutAllList = (data) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/ac/csc/HatStateService/findOutAllList',
    type: 'post',
    data: data
  })
}
// 迁入人员列表接口
export const findInApplyList = (data) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/as/csc/hatstate/findInApplyList',
    type: 'post',
    data: data
  })
}
// 迁出人员列表接口
export const findOutApplyList = (data) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/as/csc/hatstate/findOutApplyList',
    type: 'post',
    data: data
  })
}
// 迁入同意
export const updateAgree = (data) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/as/csc/hatstate/updateAgree',
    type: 'post',
    data: data
  })
}
// 迁入拒绝
export const updateDisAgree = (data) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/as/csc/hatstate/updateDisAgree',
    type: 'post',
    data: data
  })
}
// 添加申请
export const createOutApplu = (data) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/as/csc/hatstate/createOutApplu',
    type: 'post',
    data: data
  })
}
// 上级查看下级人员列表接口
export const userUpList = (data) => {
  return axios.request({
    url: config.baseUrlMZ + '/api/as/csc/hatstate/userUpList',
    type: 'post',
    data: data
  })
}
